package cn.adkii.springframework.context.event;

import cn.adkii.springframework.context.ApplicationListener;

/**
 * @author malingdi
 * @description 事件广播器
 * @date 2023/11/28 14:53
 */
public interface ApplicationEventMulticaster {

    /**
     * Add a listener to be notified of all events.
     * @param listener the lister to add
     */
    void addApplicationListener(ApplicationListener<?> listener);

    /**
     * remove a listener from the notification list.
     * @param listener the listener to remove.
     */
    void removeApplicationListener(ApplicationListener<?> listener);

    /**
     * Multicast the given application event to appropriate listeners.
     * @param event the event to multicast
     */
    void multicastEvent(ApplicationEvent event);
}
